package 类作为成员变量;

public class test {
    public static void main(String[] args) {
        //创建英雄
        Hero one = new Hero();
        //设定参数
        one.setLevel(25);
        one.setName("黑暗游侠");
        //创建武器
        weapon weapon = new weapon();
        weapon.setWeaponname("霜之哀伤");
        //给对象设定武器
        one.setWeapon(weapon);
        one.attack();

    }
}
